import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';

import { ApiHideProperty, ApiProperty } from "@nestjs/swagger";

@Entity({ name: 'collection' })
export class CollectionEntity {

    @PrimaryGeneratedColumn()
    @ApiProperty({ description: '主键ID' })
    id: number

    @Column()
    @ApiProperty({ description: '用户id' })
    userId: number

    @Column()
    @ApiProperty({ description: '商品id' })
    productId: number

    @Column()
    @ApiProperty({ description: '商品名称' })
    productName: string

    @Column()
    @ApiProperty({ description: '商品图片' })
    productImg: string

    @Column()
    @ApiProperty({ description: '商品价格' })
    price: number

    @CreateDateColumn()
    // @ApiProperty({description: '创建时间'})
    @ApiHideProperty()
    createdTime: Date

    @UpdateDateColumn()
    // @ApiProperty({description: '更新时间'})
    @ApiHideProperty()
    updatedTime: Date

}